package com.yc.snack.dao.impl;

import com.yc.snack.dao.IAdminInfoDao;
import com.yc.snack.dao.util.DBUtil;
import com.yc.snack.entity.AdminInfo;

/**
 * @Auther: HuYang
 * @Date: 2022/11/6 - 11 - 06 - 11:35
 * @Description: com.yc.snack.dao.impl
 * @version: 1.0
 */
public class AdminInfoDaoImpl implements IAdminInfoDao {
    @Override
    public AdminInfo login(AdminInfo af) {
        DBUtil db = new DBUtil();
        String sql = "select aid,aname,tel from admininfo where (aname = ? or tel = ?) and pwd = md5(?) and status != 0";
        return db.find(AdminInfo.class,sql,af.getAname(),af.getAname(),af.getPwd());
    }
}
